﻿@{
    Layout = null;
}

<!DOCTYPE html>

<html>
<head>
    <title>Index</title>
    @*引入easyUI的CSS文件*@
    <link href="../../Content/jquery-easyui-1.3.1/themes/default/easyui.css" rel="stylesheet" />
    <link href="../../Content/jquery-easyui-1.3.1/themes/icon.css" rel="stylesheet" />
    @*引入Ztree的CSS文件*@
    <link href="../../Content/JQuery%20zTree%20v2.6/demo/zTreeStyle/zTreeStyle.css" rel="stylesheet" />
    <link href="../../Content/JQuery%20zTree%20v2.6/demo/zTreeStyle/zTreeIcons.css" rel="stylesheet" />
    @*引入Jquery的JS文件*@
    <script src="../../Content/jquery-easyui-1.3.1/jquery-1.8.0.min.js"></script>
    @*引入easyUI的JS文件*@
    <script src="../../Content/jquery-easyui-1.3.1/jquery.easyui.min.js"></script>
    <script src="../../Content/jquery-easyui-1.3.1/locale/easyui-lang-zh_CN.js"></script>
    @*引入Ztree的JS文件*@
    <script src="../../Content/JQuery%20zTree%20v2.6/jquery.ztree-2.6.js"></script>

    <script type="text/javascript">
        $(function () {
            //加载表单数据
            LoadCategoryInfo();
        });

        //加载属性设置的表单对象
        function LoadCategoryInfo(queryParame) {
            $('#test').datagrid({
                title: '用户权限管理',
                iconCls: 'icon-save',
                height: 400,
                nowrap: true,
                autoRowHeight: false,
                striped: true,
                collapsible: true,
                url: '/ActionInfo/GetActionUserInfoShow',
                sortName: 'ID',
                sortOrder: 'asc',
                border: true,
                remoteSort: false,
                idField: 'ID',
                pagination: true,
                rownumbers: true,
                queryParams: queryParame,
                columns: [[
                    { field: 'ck', checkbox: true },
                    { field: 'ID', title: 'ID', width: 50, sortable: true },
                    { field: 'ActionName', title: "权限名称", width: 150, sortable: true, },
                    { field: 'RequestHttpType', title: "请求方式", width: 150, sortable: true, },
                    { field: 'RequestUrl', title: '请求地址', width: 360, sortable: true },
                      {
                          field: 'ActionType', title: "权限类型", width: 150, sortable: true,
                          formatter: function (value, row, index) {
                              if (value == "0") {
                                  return "普通权限";
                              }
                              else {
                                  return "菜单权限";
                              }
                          }
                      }
                ]],

                toolbar: [{
                    id: 'btnadd',
                    text: '添加权限',
                    iconCls: 'icon-add',
                    handler: function () {
                        //实现弹出添加用户信息的层
                        ShowCreateActionInfoDialog();
                    }
                }, '-', {
                    id: 'btncut',
                    text: '修改权限',
                    iconCls: 'icon-cut',
                    handler: function () {

                        //实现弹出修改用户信息的层
                        ShowUpdateActionInfoDialog();
                    }
                }, '-', {
                    id: 'btnsave',
                    text: '删除权限',
                    iconCls: 'icon-remove',
                    handler: function () {
                        //确认只删除一条用户信息
                        DeleteActionInfoByClick();
                    }
                }, '-', {
                    id: 'btnSetAction',
                    text: '设置角色',
                    iconCls: 'icon-redo',
                    handler: function () {
                        //设置用户角色权限
                        SetActionInfoRole();
                    }
                }]
            });
        }

    </script>

</head>
<body>
    @*-------------------------- 实现对属性数据数据的显示-------------------------*@
    <div>
        <table id="test"></table>
    </div>
    <!--弹出分类对话框-->
    <div id="addCatDiv">

    </div>
</body>
</html>
